<script setup lang="ts">

//任何一个事件都有对应的事件对象
//事件对象：描述这个事件的

//如果没有实参传递，则直接定义形参接收

//如果有实参传递，实参用$event(代表事件对象) 形成用3
const toggle = (e:MouseEvent) => {
  console.log('点击了',e);
  
}
const toggle1 = (str:string,e:MouseEvent) => {
  console.log(str,e);
}

</script>

<template>
  <div class="app-page">
    <button @click="toggle">切点击了 </button>
    <button @click="toggle1('xx',$event)">xx</button>
  </div>
</template>

<style lang="css" scoped></style>
